package com.shujia.flink.tf;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Demo03Filter {
    public static void main(String[] args) throws Exception {

        // filter：过滤数据
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();


        DataStreamSource<String> socketDS = env.socketTextStream("master", 8888);

        socketDS.filter(s -> Integer.parseInt(s) % 2 == 1).print();

        env.execute();

    }
}
